<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn1">美女1号</button>
    <button id="btn2">美女2号</button>
    <img src="" alt="" id="img1" title="">
    <script>
        //修改元素属性src
        //获取元素
        var btn1 = document.getElementById('btn1');
        var btn2 = document.getElementById('btn2');
        var img1 = document.getElementById('img1');
        //2.注册事件
        btn1.onclick = function(){
            img1.src = '/imge/美女1.jpg';
            img1.title= '美女1';
        }
        btn2.onclick = function(){
            img1.src = '/imge/美女2.jpg'
            img1.title = '美女2';
        }
    </script>
</body>
</html>